<?php
// +----------------------------------------------------------------------
// | WoShiMaiJia Projcet 
// +----------------------------------------------------------------------
// | Copyright (c) 2010-2011 http://woshimaijia.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: xinqiyang <xinqiyang@gmail.com>
// +----------------------------------------------------------------------
return array(

	//cache key config
	//the key is sort by data property    string/hashes/lists/sets/sortedsets/    count use string to store
    'data_key'=>array(
    	'prefix'=>'bdk:',
		'object' => 'h:', // key:  bdk:h:object:13132274644527071 // bdk:h:13132274644527071 //objectid
    	'lists'=>'l:', // key bdk:l:inbox:13132274644527071   // userid
		'sets'=>'s:', // key bdk:s:inbox:13132274644527071   // userid
		'ssets'=>'z:', // key bdk:s:inbox:13132274644527071   // userid
    ),
    
    //user behavior @todo could extend ,add the user behavior here
    'behavior' => array('view','post','like','buy','collect','go','focus','send','chat','own','scoring'),

	//REDIS NODE
	//MAIN STORE ENGIN
   'redis'=>array(
	    //redis master
	    'redis'=>array(
	    	'host'=>'127.0.0.1',
	    	'port'=>6379,
	    	'slaves'=>array(
		    	array(
		    	'host'=>'127.0.0.1',
		    	'port'=>6380,
		    	),
	    	),
	    ),
	    'stat'=>array(
	    	'host'=>'127.0.0.1',
	    	'port'=>6379,
	    	'slaves'=>array(
		    	array(
		    	'host'=>'127.0.0.1',
		    	'port'=>6380,
		    	),
	    	),
	    ),
    ),
    
    //mongodb node
    'mongo'=>array(
    	'mongo'=>array(
    		'instances'=>'127.0.0.1:27017',
    		'autobalance'=>true,
    		'connect'=>true,
    		'database'=>'mongo',
    	),
    	'mongoread'=>array(
    		'instances'=>array(
    			'127.0.0.1:27017',
    			'127.0.0.1:27017',
    		),
    		'autobalance'=>true,
    		'connect'=>true,
    		'database'=>'mongo',
    	),
    	'stat'=>array(
    		'instances'=>array(
    			'127.0.0.1:27017',
    		),
    		'autobalance'=>true,
    		'connect'=>true,
    		'database'=>'stat',
    	),
    ),
    
    'mysql'=>array(
    	//db configuration
    	'mysql'=>array(
	    'dbms' => 'mysql',
	    'username' => 'root',
	    'password' => '123456',
	    'hostname' => '127.0.0.1',
	    'hostport' => '3306',
	    'database' => 'wsmj',
	    'db_prefix' => 'sz_',
	    'fields_cache'=>TRUE, //if set false then no flush table info
	    'fields_cache_path'=>'/home/xinqiyang/wwwlogs/web.dev.woshimaijia.com/',//  
		'use_slaves'=>TRUE, //use slaves  true/false
	    'slaves' => array(
	        array('username' => 'root',
	            'password' => '123456',
	            'hostname' => '127.0.0.1',
	            'hostport' => '3306'),
	        array('username' => 'root',
	            'password' => '123456',
	            'hostname' => '127.0.0.1',
	            'hostport' => '3306'),
	        array('username' => 'root',
	            'password' => '123456',
	            'hostname' => '127.0.0.1',
	            'hostport' => '3306'),
	        array('username' => 'root',
	            'password' => '123456',
	            'hostname' => '127.0.0.1',
	            'hostport' => '3306'),
	    	)
    	),
    	
    	'blog'=>array(
	    'dbms' => 'mysql',
	    'username' => 'root',
	    'password' => '123456',
	    'hostname' => '127.0.0.1',
	    'hostport' => '3306',
	    'database' => 'blog',
	    'db_prefix' => 'yxq_',
	    'fields_cache'=>TRUE, //if set false then no flush table info
	    'fields_cache_path'=>'/home/xinqiyang/wwwlogs/web.dev.woshimaijia.com/',//  
		'use_slaves'=>TRUE, //use slaves  true/false
	    'slaves' => array(
	        array('username' => 'root',
	            'password' => '123456',
	            'hostname' => '127.0.0.1',
	            'hostport' => '3306'),
	        array('username' => 'root',
	            'password' => '123456',
	            'hostname' => '127.0.0.1',
	            'hostport' => '3306'),
	        array('username' => 'root',
	            'password' => '123456',
	            'hostname' => '127.0.0.1',
	            'hostport' => '3306'),
	        array('username' => 'root',
	            'password' => '123456',
	            'hostname' => '127.0.0.1',
	            'hostport' => '3306'),
	    	)
    	),

    ),
    //QUEUE
    'queue'=>array(
    	//set the main queue
    	'queue'=>array('host'=>'127.0.0.1','port'=>'55555'),
    ),
    //Log Node
    'log'=>array(
    	
    	'Web'=>array(
    		'dir'=>'/home/xinqiyang/wwwlogs/web.dev.woshimaijia.com/',
		    'file'=>'logall',
		    'level'=>16,
		    'info'=>array('uid'=>'','ip'=>'','traceid'=>''),
		    'flush'=>false,
    	),
    	'Wap'=>array(
    		'dir'=>'/home/xinqiyang/wwwlogs/web.dev.woshimaijia.com',
		    'file'=>'logall',
		    'level'=>16,
		    'info'=>array('uid'=>'','ip'=>'','traceid'=>''),
		    'flush'=>false,
    	),
    	'Mis'=>array(
    		'dir'=>'/home/xinqiyang/wwwlogs/web.dev.woshimaijia.com',
		    'file'=>'logall',
		    'level'=>16,
		    'info'=>array('uid'=>'','ip'=>'','traceid'=>''),
		    'flush'=>false,
    	),
    	'Api'=>array(
    		'dir'=>'/home/xinqiyang/wwwlogs/web.dev.woshimaijia.com/',
		    'file'=>'logall',
		    'level'=>16,
		    'info'=>array('uid'=>'','ip'=>'','traceid'=>''),
		    'flush'=>false,
    	),
    	'BackEnd'=>array(
    		'dir'=>'/home/xinqiyang/wwwlogs/web.dev.woshimaijia.com/',
		    'file'=>'logall',
		    'level'=>16,
		    'info'=>array('uid'=>'','ip'=>'','traceid'=>''),
		    'flush'=>false,
    	),
    ),
    
    //Image resource node
    'image'=>array(
    	'image'=>array(
    		's'=>array(160,100,48),
    		'b'=>array(500),
    		'path'=>'/home/xinqiyang/wwwroot/woshimaijia/trunk/src/php/Presentation/Images/images/',
    	),
    	
    ),
    
    //Memcache Node
    'cache'=>array(
    	'memcached'=>array(
    		'type'=>'memcached',
    		'machines'=>array(
    			array('127.0.0.1','12000','90'),
    			array('127.0.0.1','12000','10'),
    		)
    	),
    	'memcache'=>array(
    		'type'=>'memcache',
    		'machines'=>array(
    			array('127.0.0.1','12000','90'),
    			array('127.0.0.1','12000','10'),
    		)
    	),
    ),
    
    //Session Server node
    'session'=>array(
    	//store session info to redis
    	'Web'=>array('handler'=>'redis','path'=>'tcp://127.0.0.1:6379'),
    	'Wap'=>array('handler'=>'redis','path'=>'tcp://127.0.0.1:6379'),
    	//SET OPEN API
    	'Api'=>array('handler'=>'redis','path'=>'tcp://127.0.0.1:6379'),
    ),
    
    
    
);
